package com.tc.rocketmq.basic;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @Auther: tianchao
 * @Date: 2021/9/5 21:39
 * @Description:
 */
@Component
@Slf4j
@RocketMQMessageListener(consumerGroup = "BootTestTopic2",topic = "BootTestTopic2")
public class SpringConsumer implements RocketMQListener<MessageExt> {
    @Override
    public void onMessage(MessageExt message) {
        String tags = message.getTags();
        log.error("接受事务id ,{}",message.getTransactionId());
        log.info("receive:{}:::TAGS{}  " + message,tags);
    }
}
